package function;

public class Person {
    public String name;
    public int age;
//    方法声明和实现
    static void myMethod(){
        System.out.println("我执行了");
    }
//    构造函数
    public Person(String names){
        System.out.println("构造了Person");
        name=names;
    }
    public static void main(String[] args) {
        Person child=new Person("Tom");
//        局部变量
        int ages=18;
        child.age=ages;
        myMethod();
        System.out.println(child.name+child.age);
    }
}
//构造了Person
//我执行了
//Tom18
